package com.vilen.basic.dao;

import com.vilen.basic.model.User;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2016/2/17.
 */
@Repository("userDao")
public class UserDao extends BaseDao<User> implements IUserDao{

    @Override
    public User loadByUsername(String username) {
        return (User) super.queryObject("from User where username=?",username);
    }

    //TODO 果然这里老师写成了 username=
    @Override
    public User loadByOpenId(String openid) {
        return (User) super.queryObject("from User where openid=?",openid);
    }

    @Override
    public List<User> list() {
        return super.list("from User");
    }
}
